package vip.meeet.jdk.mem;

/**
 * -Xmx20M -XX:MaxDirectMemorySize=10M
 */
public class DirectMemoryOOM {

    public static final int MB = 1024 * 1024;

    public static void main(String[] args) throws IllegalAccessException {
//        Field field = Unsafe.class.getDeclaredFields()[0];
//        field.setAccessible(true);
//        Unsafe unsafe = (Unsafe) field.get(null);
//        while (true){
//            unsafe.allocateMemory(MB);
//        }
    }
}
